
package com.fx.apartment.modules.dynamic.wrapper;


import com.fx.apartment.modules.dynamic.entity.Dynamic;
import com.fx.apartment.modules.dynamic.vo.DynamicVO;
import com.fx.apartment.common.support.BaseEntityWrapper;
import com.fx.apartment.common.tool.utils.BeanUtil;

import java.util.Objects;

/**
 * 朋友圈动态包装类,返回视图层所需的字段
 *
 * @author QinXueFeng
 * @since 2021-04-19
 */
public class DynamicWrapper extends BaseEntityWrapper<Dynamic, DynamicVO> {

	public static DynamicWrapper build() {
		return new DynamicWrapper();
 	}

	@Override
	public DynamicVO entityVO(Dynamic dynamic) {
		DynamicVO dynamicVO = Objects.requireNonNull(BeanUtil.copy(dynamic, DynamicVO.class));

		//User createUser = UserCache.getUser(dynamic.getCreateUser());
		//User updateUser = UserCache.getUser(dynamic.getUpdateUser());
		//dynamicVO.setCreateUserName(createUser.getName());
		//dynamicVO.setUpdateUserName(updateUser.getName());

		return dynamicVO;
	}

}
